<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ include file="../language.jsp" %>
<%
request.setAttribute("errorInfo",request.getParameter("error"));
%>
<!DOCTYPE>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />

	<title><fmt:message key="i18n.login" />-<fmt:message key="i18n.title"/></title>
	<link rel="shortcut icon" href="../images/favicon.png" />

	<!-- bootstrap -->
    <link href="css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="css/layout.css" />
    <link rel="stylesheet" type="text/css" href="css/elements.css" />
    <link rel="stylesheet" type="text/css" href="css/icons.css" />

    <!-- libraries -->
    <link rel="stylesheet" type="text/css" href="css/lib/font-awesome.css" />
    
    <!-- this page specific styles -->
    <link rel="stylesheet" href="css/compiled/signin.css" type="text/css" media="screen" />


	<script type="text/javascript" src="../scripts/user/common.js"></script>
	<script type="text/javascript" src="../scripts/user/login.js"></script>
</head>
<body class="login-bg" style='background-image: url("img/bgs/blueish.jpg");'>
	<div class="row-fluid login-wrapper">
        <a href="#">
            <img src="img/logo_${lang}.png" class="logo" />
        </a>

        <div class="span4 box">
            <div class="content-wrap">
            	<form action="registerUser!login.action" method="post" class="login_form" id="my-form">
	                <h6><fmt:message key="i18n.userLogin" /></h6>
	                <select class="span12" onchange="setLanguage(this.value)" style="height:40px;margin-bottom:18px;">
	                	<option value=""><fmt:message key="i18n.lanauger" /></option>
                    	<option value="en_US" <c:if test="${lang eq 'en_US' }">selected="selected"</c:if>><fmt:message key="i18n.en" /></option>
                        <option value="zh_CN" <c:if test="${lang eq 'zh_CN' }">selected="selected"</c:if>><fmt:message key="i18n.zh" /></option>
                        <option value="zh_TW" <c:if test="${lang eq 'zh_TW' }">selected="selected"</c:if>><fmt:message key="i18n.tw" /></option>
                    </select>
	                <input class="span12" id="loginName" name="registerUserDTO.loginName" type="text" placeholder="<fmt:message key="i18n.loginName" />" />
	                <input class="span12" id="password" name="registerUserDTO.password1" type="password" placeholder="<fmt:message key="i18n.loginPassword" />" />
	                <input class="span6" style="float: left;" id="userLogin_validCode" type="text" placeholder="<fmt:message key="i18n.valicode" />" /> 
	               	<a href="javascript:refreshCheckCode('login_codeImg');" class="span6"  style="height: 40px;padding-top: 5px;">
           					<img id="login_codeImg" border=0 src="randomCode" class="yzm"/>
         			</a>
	                <a href="findPwd.jsp" target="_blank" class="forgot"><fmt:message key="i18n.findPassword" />?</a>
	                <br>
	                <a class="btn-glow primary" onclick="userLogin('yes')" ><fmt:message key="i18n.login" /></a>
	                <a class="btn-glow primary" href="register.jsp" target="_blank" ><fmt:message key="i18n.yonghureg" /></a>
	                
	                <p style="color:red">
	                <br>
	                	<c:if test="${errorInfo eq 'LoginNameOrPasswordError' }"><fmt:message key="i18n.loginTip1" /></c:if>
			     		<c:if test="${errorInfo eq 'NotActivation' }"><fmt:message key="i18n.loginTip2" /></c:if>
			     		<c:if test="${errorInfo eq 'LoginNameAlreadyLock' }"><fmt:message key="i18n.loginTip3" /></c:if>
	                </p>
                </form>
            </div>
        </div>
    </div>


	
	<!-- scripts -->
    <script src="js/jquery-latest.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/theme.js"></script>
	<script type="text/javascript">
		$(function(){
			document.onkeydown = function(evt){
				var evt = window.event?window.event:evt;
				if(evt.keyCode==13){
					userLogin('yes');
				}
			}
		});
	</script>
</body>
</html>